package br.eng.megaprojetos.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name="state")
public class State extends PersistentEntity {

	@Column(name="acronym", nullable=false, unique=true, updatable=false, length=10)
	private String acronym;
	
	@Column(name="name", nullable=false, unique=false, updatable=true, length=100)
	private String name;

	public String getSigla() {
		return acronym;
	}

	public void setSigla(String sigla) {
		this.acronym = sigla;
	}

	public String getNome() {
		return name;
	}

	public void setNome(String nome) {
		this.name = nome;
	}

	@Override
	public String toString() {
		if(acronym == null){
			return super.toString();
		}
		return acronym;
	}
	
}
